#include <telepathy-glib/debug-sender.h>
#include "shell-a11y.h"
+#include "shell-global.h"
#include "shell-global-private.h"
#include "shell-perf-log.h"
#include "st.h"
#define SHELL_DBUS_SERVICE "org.gnome.Shell"
#define MAGNIFIER_DBUS_SERVICE "org.gnome.Magnifier"
+static gboolean is_gdm_mode = FALSE;
+
static void
shell_dbus_init (gboolean replace)
{
N_("Print version"),
NULL
},
+ {
+ "gdm-mode", 0, 0, G_OPTION_ARG_NONE,
+ &is_gdm_mode,
+ N_("Mode used by GDM for login screen"),
+ NULL
+ },
{ NULL }
};
{
GOptionContext *ctx;
GError *error = NULL;
+ ShellSessionType session_type;
int ecode;
TpDebugSender *sender;
g_log_set_default_handler (default_log_handler, sender);
/* Initialize the global object */
- _shell_global_init (NULL);
+ if (is_gdm_mode)
+ session_type = SHELL_SESSION_GDM;
+ else
+ session_type = SHELL_SESSION_USER;
+
+ _shell_global_init ("session-type", session_type, NULL);
ecode = meta_run ();
MetaScreen *meta_screen;
GdkScreen *gdk_screen;
+ ShellSessionType session_type;
+
/* We use this window to get a notification from GTK+ when
* a widget in our process does a GTK+ grab. See
* http://bugzilla.gnome.org/show_bug.cgi?id=570641
enum {
PROP_0,
+ PROP_SESSION_TYPE,
PROP_OVERLAY_GROUP,
PROP_SCREEN,
PROP_GDK_SCREEN,
case PROP_STAGE_INPUT_MODE:
shell_global_set_stage_input_mode (global, g_value_get_enum (value));
break;
-
+ case PROP_SESSION_TYPE:
+ global->session_type = g_value_get_enum (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
switch (prop_id)
{
+ case PROP_SESSION_TYPE:
+ g_value_set_enum (value, shell_global_get_session_type (global));
+ break;
case PROP_OVERLAY_GROUP:
g_value_set_object (value, meta_get_overlay_group_for_screen (global->meta_screen));
break;
G_TYPE_STRING,
G_TYPE_STRING);
+ g_object_class_install_property (gobject_class,
+ PROP_SESSION_TYPE,
+ g_param_spec_enum ("session-type",
+ "Session Type",
+ "The type of session",
+ SHELL_TYPE_SESSION_TYPE,
+ SHELL_SESSION_USER,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class,
PROP_OVERLAY_GROUP,
g_param_spec_object ("overlay-group",
return status == CAIRO_STATUS_SUCCESS;
}
+
+/**
+ * shell_global_get_session_type:
+ * @global: The #ShellGlobal.
+ *
+ * Gets the type of session gnome-shell provides.
+ *
+ * The type determines what UI elements are displayed,
+ * what keybindings work, and generally how the shell
+ * behaves.
+ *
+ * A session type of #SHELL_SESSION_USER means gnome-shell
+ * will enable the activities overview, status menu, run dialog,
+ * etc. This is the default.
+ *
+ * A session type of #SHELL_SESSION_GDM means gnome-shell
+ * will enable a login dialog and run in a more confined
+ * way. This type is suitable for the display manager.
+ *
+ * Returns the type of session gnome-shell is providing.
+ */
+ShellSessionType
+shell_global_get_session_type (ShellGlobal *global)
+{
+ g_return_val_if_fail (SHELL_IS_GLOBAL (global),
+ SHELL_SESSION_USER);
+
+ return global->session_type;
+}
void shell_global_launch_calendar_server (ShellGlobal *global);
-
typedef void (*ShellGlobalScreenshotCallback) (ShellGlobal *global, gboolean success);
void shell_global_screenshot_area (ShellGlobal *global,
void shell_global_screenshot (ShellGlobal *global,
const char *filename,
ShellGlobalScreenshotCallback callback);
+typedef enum {
+ SHELL_SESSION_USER,
+ SHELL_SESSION_GDM
+} ShellSessionType;
+
+ShellSessionType shell_global_get_session_type (ShellGlobal *global);
G_END_DECLS